package com.atguigu.sparkstreaming.utils

/**
 * Created by Smexy on 2022/7/19
 */
object EthierDemo {

  def main(args: Array[String]): Unit = {

    println(Demo(" "))
    println(Demo("Some string we are passing here"))
    println(Demo(""))

    Demo("") match {
      case Left(a) => println(a + "不符合要求!")
      case Right(a) => println(a + "不符合要求!")
    }
  }

  // Your code here
  def Demo(name: String): Either[String, String] =
  {
    if (!name.isEmpty)
      Right(name)
    else
      Left("Empty String not passed!! ")
  }
}
